﻿<%@ Page Language="C#" MasterPageFile="~/UserControl_Manager/MasterPage_Manager.Master" AutoEventWireup="true" CodeBehind="RevenueByCatalogue.aspx.cs" Inherits="TMDT_Nhom1A.Manager.RevenueByCatalogue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript"> 
		
		    var firstSeries='<%= ParentCatologueData %>';  
            var secondSeries = '<%= RevenueData %>'
            
		    var seriesOne = new Array();  		    
            seriesOne= firstSeries.split(',');  
           
            
            var seriesTwo = new Array();  
            seriesTwo= secondSeries.split(',');  
            for(var i=0;i<seriesTwo.length;i++)  
            {  
                seriesTwo[i]= parseInt(seriesTwo[i]);  
            } 
            
            var _parentCatalogueData = seriesOne;
            var _revenueData =  seriesTwo;
            
			var chart;
			
			$(document).ready(function() {
			    chart = new Highcharts.Chart({
					chart: {
						renderTo: 'container',
						defaultSeriesType: 'column',
						margin: [ 50, 50, 100, 80]
					},
					title: {
						text: 'Doanh Thu Theo Từng Loại Sản Phẩm'
					},
					xAxis: {
						categories: _parentCatalogueData,
						labels: {
							rotation: -45,
							align: 'right',
							style: {
								 font: 'normal 13px Verdana, sans-serif'
							}
						}
					},
					yAxis: {
						min: 0,
						title: {
							text: 'Doanh Thu'
						}
					},
					legend: {
						enabled: false
					},
					tooltip: {
						formatter: function() {
							return '<b>'+ this.x +'</b><br/>'+
								 'doanh thu: '+ Highcharts.numberFormat(this.y, 1) + ' VND' ;
								 
						}
					},
				        series: [{
						name: 'Doanh Thu',
						data: _revenueData,
						dataLabels: {
							enabled: true,
							rotation: -90,
							color: '#FFFFFF',
							align: 'right',
							x: -3,
							y: 10,
							formatter: function() {
								return this.y;
							},
							style: {
								font: 'normal 13px Verdana, sans-serif'
							}
						}			
					}]
				});
				
				$('tspan').last().remove();
			});
							
    </script>

    <div class="module_round_box_inner">
        <div class="module_round_box_inner2">
            <div class="s5_mod_h3_1">
                <div class="s5_mod_h3_2">
                    <h3 class="s5_mod_h3">
                        <span class="s5_h3_first">Báo Cáo Doanh Thu Theo Từng Loại Sản Phẩm</span>
                    </h3>
                </div>
            </div>
            <br />
                <div id="container" style="width: 680px; height: 400px; margin: 0 auto">
                </div>
            <br />
            <br />
            
        </div>
    </div>
</asp:Content>
